<LayoutEditFormBox :loading="load">
    <template slot="main">
        <!-- 添加原因对话框 -->
        <el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  title="添加金额" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
            <el-input v-model="addAmount" placeholder="请输入金额"></el-input>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="addFixed();">确 定</el-button>
            </span>
        </el-dialog>

        <el-form ref="editForm" :model="form" label-width="200px" label-position="left" :rules="rules">

            <LayoutCell>
                <LayoutCellItem title="基础">
                    <el-form-item label="会员充值">
                        <el-radio-group v-model="form.isOpenRecharge">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="余额文字定义" v-if="form.isOpenRecharge" prop="moneyMark"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMoneyMark(rule, value, callback)}}]">
                        <el-input style="width:200px;" type="text" placeholder="请输入内容" v-model="form.moneyMark"
                            maxlength="10" show-word-limit>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="充值限制" v-if="form.isOpenRecharge">
                        <el-radio-group v-model="form.isLimitRecharge">
                            <el-radio :label="0">不限制</el-radio>
                            <el-radio :label="1">限制</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if="form.isLimitRecharge && form.isOpenRecharge" prop="minAmount"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMinAmount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.isOpenMinAmount" :true-label="1" :false-label="0"
                            @change="validate()">
                            单次最少充值
                        </el-checkbox>
                        <el-input v-model="form.minAmount" maxlength="10" style="width: 200px;"
                            :disabled="!form.isOpenMinAmount">
                            <template slot="append">元</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item v-if="form.isLimitRecharge  && form.isOpenRecharge" prop="maxAmount"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMaxAmount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.isOpenMaxAmount" :true-label="1" :false-label="0"
                            @change="validate()">
                            单次最多充值
                        </el-checkbox>
                        <el-input v-model="form.maxAmount" maxlength="10" style="width: 200px;"
                            :disabled="!form.isOpenMaxAmount">
                            <template slot="append">元</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="充值金额" v-if="form.isOpenRecharge">
                        <div class="box">
                            <el-checkbox v-model="form.isOpenFixed" :true-label="1" :false-label="0">固定充值金额
                            </el-checkbox>
                            <el-button @click="dialogVisible = true" style="margin-left:10px" size="mini">添加</el-button>
                        </div>
                    </el-form-item>
                    <el-form-item v-if="!$vFN.Utils.isEmpty(form.fixedAmountLst) &&  form.isOpenRecharge">
                        <div>
                            <el-tag class="tagStyle" v-for="(tag,index) in form.fixedAmountLst" :key="index" closable
                                @close="deleteTagAmount(index)">
                                {{tag}}
                            </el-tag>
                        </div>
                    </el-form-item>
                    <el-form-item v-if="form.isOpenRecharge">
                        <el-checkbox v-model="form.isOpenCustom" :true-label="1" :false-label="0">
                            自定义输入金额
                        </el-checkbox>
                    </el-form-item>
                    <el-form-item label="余额提现">
                        <el-radio-group v-model="form.isOpenWithdraw">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="最低提现额度" v-if="form.isOpenWithdraw" prop="minWithdrawAmount"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMinWithdrawAmount(rule, value, callback)}}]">
                        <el-input v-model="form.minWithdrawAmount" maxlength="10" style="width: 200px;">
                            <template slot="append">元</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="提现手续费" v-if="form.isOpenWithdraw" prop="withdrawFee"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validator(rule, value, callback)}}]">
                        <el-input v-model="form.withdrawFee" maxlength="10" style="width: 200px;">
                            <template slot="append">%</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="免手续费区间" v-if="form.isOpenWithdraw" prop="minExemptFee"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMinExemptFee(rule, value, callback)}}]">
                        <el-input v-model="form.minExemptFee" maxlength="10" style="width: 200px;"
                            onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))">
                            <template slot="append">元</template>
                        </el-input>
                        <span style="padding:0 10px;">至</span>
                        <el-input v-model="form.maxExemptFee" maxlength="10" style="width: 200px;"
                            onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))">
                            <template slot="append">元</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item v-if="form.isOpenWithdraw">
                        <span class="tips">当提现手续费金额在此区间时，不扣除提现手续费</span>
                    </el-form-item>
                    <el-form-item label="提现审核" v-if="form.isOpenWithdraw">
                        <el-radio-group v-model="form.isOpenAutoAudit">
                            <el-radio :label="0">手动审核</el-radio>
                            <el-radio :label="1">自动审核</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="自动打款" v-if="form.isOpenWithdraw">
                        <el-radio-group v-model="form.isOpenAutoPay">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="支持银行卡" v-if="form.isOpenWithdraw">
                        <div class="box">
                            <el-input v-model="bankInput" maxlength="30" style="width: 300px;" placeholder="请填写银行名称"
                                clearable>
                            </el-input>
                            <el-button style="margin-left: 10px;" @click="addBank">添加</el-button>
                        </div>
                    </el-form-item>
                    <el-form-item v-if="!$vFN.Utils.isEmpty(form.supportBankLst) && form.isOpenWithdraw">
                        <el-tag class="tagStyle" v-for="(tag,index) in form.supportBankLst" :key="index" closable
                            @close="deleteTagBank(index)">
                            {{tag}}
                        </el-tag>
                    </el-form-item>
                    <el-form-item label="提现设置">
                        <div class="withdrawType" v-for="(typeItem,typeIndex) of form.moneySettingItemLst"
                            :key="typeIndex">
                            <div class="item">
                                <el-checkbox v-model="typeItem.isOpen" :true-label="1" :false-label="0">
                                    提现到{{typeItem.withdrawTypeDesc}}
                                </el-checkbox>
                                <span class="tips" v-if="typeItem.withdrawType == 1">
                                    需要配置企业提现到零钱
                                </span>
                                <span class="tips" v-if="typeItem.withdrawType == 2">
                                    如配置汇聚代付，可自动付款到银行卡，否则需手动打款
                                </span>
                                <span class="tips" v-if="typeItem.withdrawType == 3">
                                    手动打款
                                </span>
                            </div>
                        </div>
                    </el-form-item>

                </LayoutCellItem>

            </LayoutCell>


        </el-form>
    </template>
    <template slot="footer">
        <el-button type="primary" @click="submit">确定</el-button>
    </template>
</LayoutEditFormBox>